home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / pbvl010.zip / TUTOR2_1.BAS < prev    next >
BASIC Source File  |  1994-02-10  |  2KB  |  64 lines

  1. '┌─────────────────────────────────────────────────────────────────────────┐
  2. '│    FILE: TUTOR2_1.BAS                                                   │
  3. '│ PURPOSE: PB/VISION(tm) LITE Tutorial Example Program                    │
  4. '├─────────────────────────────────────────────────────────────────────────┤
  5. '│ For instant help on any PB/VISION(tm) keyword, place the cursor on that │
  6. '│ keyword and press <CTRL-F1>.  The PB/VISION(tm) index can be accessed   │
  7. '│ by pressing <SHIFT-F1> twice.  The file "PBVLITE.PBH" _must_ be in the  │
  8. '│ same directory as the PowerBASIC IDE (PB.EXE) for this feature to work  │
  9. '│ properly.                                                               │
  10. '└─────────────────────────────────────────────────────────────────────────┘
  11.  
  12. %ISPBU = 0
  13.  
  14. DEFINT A-Z
  15. $DYNAMIC
  16.  
  17. $INCLUDE ".\WINDOW.BI"
  18.  
  19. ' ─ ■ 2.1.1 - INCLUDING THE "EVENT DRIVER" ROUTINES ───────────────────────
  20.  
  21. $INCLUDE "EVENT.BI"
  22.  
  23.     APP.GRAPHICSMODE = 1                    ' adds graphical mapping
  24.     APP.ATTR = &H80                         ' sets desktop color
  25.     APP.PATTERN = 32                        ' sets desktop fill pattern
  26.  
  27.     APPTITLE &HF0, "TUTOR2_1.BAS - AN EVENT-DRIVEN PROGRAM"
  28.  
  29.     APPINIT
  30.  
  31.     AuntEdna = WINOPEN(10, 40, &H47, 1, &H4F, "AUNT EDNA'S - PRESS <ESC> TO END", &HE0, %SHADOW)
  32.     WINSHOW AuntEdna, 0, 0, 25, 80
  33.  
  34.     WINPRINT AuntEdna, 5, 13, &H4F, "Hello Aunt Edna"
  35.  
  36.     DO      ' entering the "event loop
  37.  
  38. ' ─ ■ 2.1.2 - CALLING "GETEVENT() ────────────────────────────────────────
  39.  
  40.         EventID = GETEVENT(0)
  41.  
  42.         SELECT CASE EventID
  43.  
  44.             CASE 17                 ' "No Event" event
  45.                 WINWRITE AuntEdna, "waiting...  "
  46.  
  47.             CASE 102                ' <ESC> key event
  48.                 EXIT DO
  49.  
  50.             CASE ELSE               ' Other events
  51.  
  52.         END SELECT
  53.  
  54.     LOOP
  55.  
  56. ' ─ ■ LEAVING THE "EVENT LOOP" ──────────────────────────────────────
  57.  
  58.     WINCLOSE AuntEdna
  59.  
  60.     APPCLOSE
  61.  
  62.     END
  63.  
  64.